package com.yunxi.service.dubboService.impl;

import com.github.pagehelper.PageInfo;
import com.yunxi.model.order.ExperienceCarQuota;
import com.yunxi.order.pojo.ExperienceCarQuotaVO;
import com.yunxi.order.service.ExperienceCarQuotaDubboService;
import com.yunxi.service.localService.ExperienceCarQuotaService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * <p>
 * 体验车配额表 服务实现类
 * </p>
 *
 * @author 
 * @since 2019-08-20
 */
public class ExperienceCarQuotaDubboServiceImpl implements ExperienceCarQuotaDubboService {

    @Autowired
    @Qualifier(value = "experienceCarQuotaServiceImpl")
    ExperienceCarQuotaService experienceCarQuotaService;


    @Override
    public ExperienceCarQuotaVO getById(String id) throws InvocationTargetException, IllegalAccessException {
    ExperienceCarQuota experienceCarQuota = experienceCarQuotaService.getById(id);
    ExperienceCarQuotaVO experienceCarQuotaVO = new ExperienceCarQuotaVO();
        BeanUtils.copyProperties(experienceCarQuota,experienceCarQuotaVO);
        return experienceCarQuotaVO;
    }

    @Override
    public void saveOrUpdate(ExperienceCarQuotaVO experienceCarQuotaVO) throws InvocationTargetException, IllegalAccessException {
    ExperienceCarQuota experienceCarQuota = new ExperienceCarQuota();
        BeanUtils.copyProperties(experienceCarQuotaVO,experienceCarQuota);
    experienceCarQuotaService.saveOrUpdate(experienceCarQuota);
    }

    @Override
    public void removeById(String id) {
    experienceCarQuotaService.removeById(id);
    }

    @Override
    public PageInfo<ExperienceCarQuotaVO> findPageByVO(ExperienceCarQuotaVO experienceCarQuotaVO, Integer pageNum, Integer pageSize) throws InvocationTargetException, IllegalAccessException {
      PageInfo<ExperienceCarQuotaVO> pageInfo = experienceCarQuotaService.pageByVo(experienceCarQuotaVO,pageNum,pageSize);
      return pageInfo;
   }

    @Override
    public void removeByListVo(List<ExperienceCarQuotaVO> experienceCarQuotaVOList) throws IllegalAccessException, InvocationTargetException, InstantiationException {
        experienceCarQuotaService.removeByListVo(experienceCarQuotaVOList);
    }

    @Override
    public List listByVo(ExperienceCarQuotaVO experienceCarQuotaVO) {
      return experienceCarQuotaService.listByVo(experienceCarQuotaVO);
    }
}
